package com.glory.wxelectricitypda.adapter;

import android.support.annotation.Nullable;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.glory.wxelectricitypda.R;
import com.glory.wxelectricitypda.bean.LotBean;

import java.util.List;


public class LotListAdapter extends BaseQuickAdapter<LotBean, BaseViewHolder> {

    public LotListAdapter(@Nullable List<LotBean> data) {
        super(R.layout.adapter_lot_list, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, final LotBean item) {
        helper.setText(R.id.tvLot, item.getLOTID());
        TextView tvWrite = helper.getView(R.id.tvWrite);
        if (item.isWrite()) {
            tvWrite.setText("已填");
            tvWrite.setTextColor(mContext.getResources().getColor(R.color.free_ui_blue_sky_theme_color));
        } else {
            tvWrite.setText("填写报废");
            tvWrite.setTextColor(mContext.getResources().getColor(R.color.free_ui_blue_sky_text_gray));
        }
    }
}
